<?php

/**
 * 
 * @author yuxun
 *
 */
class SystemService extends Service{
	
	public static function tabList(){
		$tab = array(
				'message'	 => '反馈邮件设置',		
		);
		return $tab;
	}
	
	public static function crossServerTabList(){
		$tab = array(
				'cross'	 => '跨服参数设置',
		);
		return $tab;
	}

	public static function searchInfo($type){
		$modSystem = new ModSystem();
		$game = PubBase::getCurrentGame();
		$params = array();
		$params['g'] = $game;
		$params['inc_type'] = $type;
		$list = $modSystem->select($params);
		$data = array();
		foreach ($list as $key=>$val){
			$data[$val['name']] = $val['value'];
		}
		return $data;
	}

	public static function doEdit($ar){
		$inc_type = $ar['type'];
		$game = PubBase::getCurrentGame();
		unset($ar['type']);
		unset($ar['r']);
		unset($ar['g']);
		$modSystem = new ModSystem();
		foreach ($ar as $key=>$val){
			$a = $modSystem->updateAll(array('value'=>$val),'game =:game and inc_type=:inc_type and name=:name',array(':game'=>$game,':inc_type'=>$inc_type,':name'=>$key));
		}
		$out = array('status'=>1,'msg'=>'修改成功','data'=>'');
		return $out;
	}


}